
<%@page import="com.liferay.portal.kernel.util.Constants"%>
<%@page import="qldc.pm.qlktcsdldc.actions.ActionHandlerConstant"%>
<%@page import="com.liferay.portal.kernel.dao.search.RowChecker"%>
<%@page import="qldc.pm.qlktcsdldc.emun.ThongTinThayDoiEnum"%>
<%@ include file="../init.jsp"%>

<%
	List<ThongTinThayDoiEnum> list = new ArrayList<ThongTinThayDoiEnum>();
	for(ThongTinThayDoiEnum thongTinThayDoiEnum : ThongTinThayDoiEnum.values()){
		list.add(thongTinThayDoiEnum);
	}
	
	String redirect = ParamUtil.getString(request, "redirect");
	long soBanNganhId = ParamUtil.getLong(request, "soBanNganhId");
	
	PortletURL backURL = renderResponse.createRenderURL();
	backURL.setParameter("mvcPath", "/html/qlktcsdldc/danh_muc_so_ban_nganh.jsp");
	backURL.setParameter("tabs1", QLKTCSDLDCContants.PAGEID_DMSBN_MAN_HINH_CHINH);
	backURL.setParameter("redirect", redirect);
%>

<portlet:actionURL var="savePhanQuyenThaoTacURL">
	<portlet:param name="<%=ActionHandlerConstant.ACTION_HANDLER_PARAM%>" value="<%=ActionHandlerConstant.DANH_MUC_SO_BAN_NGANH_ACTION%>" />
	<portlet:param name="<%=Constants.ACTION%>" value="savePhanQuyenThaoTac" />
	<portlet:param name="soBanNganhId" value="<%=String.valueOf(soBanNganhId) %>" />
	<portlet:param name="redirect" value="<%=backURL.toString() %>" />
</portlet:actionURL>
<h2 class="tle-Content">
	<liferay-ui:message key="chon-truong-dl-cong-dan" />
</h2>
<div class="main-Content">
	<form name="<portlet:namespace/>fmTruongCongDan" id="<portlet:namespace/>fmTruongCongDan" method="POST" action="" onsubmit="return false;">
		<liferay-ui:search-container emptyResultsMessage="no-web-content-were-found" rowChecker="<%= new RowChecker(renderResponse) %>" >
			<liferay-ui:search-container-results>
				<%
					results = list;
					 total = results.size();
					pageContext.setAttribute("results", results);
					pageContext.setAttribute("total", total);
				%>
			</liferay-ui:search-container-results>
			<%
				int start = 0;
			%>
			<liferay-ui:search-container-row className="ThongTinThayDoiEnum" keyProperty="value" modelVar="thongTinThayDoiEmun">
				<liferay-ui:search-container-column-text cssClass="aui-w3" name='STT' value="<%=String.valueOf(++start)%>" />
				<liferay-ui:search-container-column-text cssClass="aui-w10" name='<%=LanguageUtil.get(request.getLocale(), "ten-truong")%>' value="<%=LanguageUtil.get(portletConfig, request.getLocale(), thongTinThayDoiEmun.getKey())%>" />
			</liferay-ui:search-container-row>
			<liferay-ui:search-iterator searchContainer="<%=searchContainer%>" />

		</liferay-ui:search-container>
		
		<table class="gridnormal">
			<tr>
				<td>
					<input type="submit" class="" onclick="phanQuyenThaoTacLuu()" value="<liferay-ui:message key="luu" />" id="<portlet:namespace/>luu" /> 
					<input type="submit" class="" onclick="phanQuyenThaoTacThoat()" value="<liferay-ui:message key="thoat" />"  id="<portlet:namespace/>thoat" />
				</td>			
			</tr>
		</table>
	</form>
</div>


<script type="text/javascript">
function phanQuyenThaoTacLuu(){
	var url = '<%=savePhanQuyenThaoTacURL.toString()%>';
	$("#<portlet:namespace/>fmTruongCongDan").attr('action', url);
	$("#<portlet:namespace/>fmTruongCongDan").attr('onsubmit', 'return true;');
	$("#<portlet:namespace/>fmTruongCongDan").submit();
};
function phanQuyenThaoTacThoat(){
	location.href = '<%=backURL.toString()%>';
}
</script>


